#include <iostream>
#include <vector>
using namespace std;
using ll=long long;

int main() {
    int n,k;
    cin>>n>>k;
    vector<ll> a(n+1),b(n+1);
    for(int i=1;i<=n;i++)
        cin>>a[i];
    for(int i=1;i<=n;i++)
        cin>>b[i];

    int left=1,right=1;
    ll at=0,bt=0;
    ll ra=0,rb=0x3f3f,rt=0;;
    while(right<=n)
    {
        at+=a[right],bt+=b[right];
        while(left<=right && right-left+1>k)
        {
            at-=a[left],bt-=b[left];
            left++;
        }
        if(at>ra)
        {
            rt=left;
            ra=at;
            rb=bt;
        }
        else if(at==ra && bt<rb)
        {
            rt=left;
            ra=at;
            rb=bt;
        }

        right++;
    }
    cout<<rt<<endl;
}
